console.log("hello world!");
let uint8Array = new Uint8Array([
  123, 10, 32, 32, 34, 116, 121, 112, 101, 34, 58, 32, 34, 101, 120, 99, 97,
  108, 105, 100, 114, 97, 119, 34, 44, 10, 32, 32, 34, 118, 101, 114, 115, 105,
  111, 110, 34, 58, 32, 50, 44, 10, 32, 32, 34, 115, 111, 117, 114, 99, 101, 34,
  58, 32, 34, 104, 116, 116, 112, 115, 58, 47, 47, 101, 120, 99, 97, 108, 105,
  100, 114, 97, 119, 46, 99, 111, 109, 34, 44, 10, 32, 32, 34, 101, 108, 101,
  109, 101, 110, 116, 115, 34, 58, 32, 91, 10, 32, 32, 32, 32, 123, 10, 32, 32,
  32, 32, 32, 32, 34, 116, 121, 112, 101, 34, 58, 32, 34, 114, 101, 99, 116, 97,
  110, 103, 108, 101, 34, 44, 10, 32, 32, 32, 32, 32, 32, 34, 118, 101, 114,
  115, 105, 111, 110, 34, 58, 32, 50, 48, 44, 10, 32, 32, 32, 32, 32, 32, 34,
  118, 101, 114, 115, 105, 111, 110, 78, 111, 110, 99, 101, 34, 58, 32, 50, 57,
  49, 54, 55, 48, 56, 56, 53, 44, 10, 32, 32, 32, 32, 32, 32, 34, 105, 115, 68,
  101, 108, 101, 116, 101, 100, 34, 58, 32, 102, 97, 108, 115, 101, 44, 10, 32,
  32, 32, 32, 32, 32, 34, 105, 100, 34, 58, 32, 34, 112, 97, 53, 71, 56, 82, 81,
  89, 120, 55, 110, 48, 81, 72, 54, 81, 95, 88, 100, 67, 109, 34, 44, 10, 32,
  32, 32, 32, 32, 32, 34, 102, 105, 108, 108, 83, 116, 121, 108, 101, 34, 58,
  32, 34, 104, 97, 99, 104, 117, 114, 101, 34, 44, 10, 32, 32, 32, 32, 32, 32,
  34, 115, 116, 114, 111, 107, 101, 87, 105, 100, 116, 104, 34, 58, 32, 49, 44,
  10, 32, 32, 32, 32, 32, 32, 34, 115, 116, 114, 111, 107, 101, 83, 116, 121,
  108, 101, 34, 58, 32, 34, 115, 111, 108, 105, 100, 34, 44, 10, 32, 32, 32, 32,
  32, 32, 34, 114, 111, 117, 103, 104, 110, 101, 115, 115, 34, 58, 32, 49, 44,
  10, 32, 32, 32, 32, 32, 32, 34, 111, 112, 97, 99, 105, 116, 121, 34, 58, 32,
  49, 48, 48, 44, 10, 32, 32, 32, 32, 32, 32, 34, 97, 110, 103, 108, 101, 34,
  58, 32, 48, 44, 10, 32, 32, 32, 32, 32, 32, 34, 120, 34, 58, 32, 51, 50, 55,
  44, 10, 32, 32, 32, 32, 32, 32, 34, 121, 34, 58, 32, 49, 53, 56, 49, 44, 10,
  32, 32, 32, 32, 32, 32, 34, 115, 116, 114, 111, 107, 101, 67, 111, 108, 111,
  114, 34, 58, 32, 34, 35, 48, 48, 48, 48, 48, 48, 34, 44, 10, 32, 32, 32, 32,
  32, 32, 34, 98, 97, 99, 107, 103, 114, 111, 117, 110, 100, 67, 111, 108, 111,
  114, 34, 58, 32, 34, 116, 114, 97, 110, 115, 112, 97, 114, 101, 110, 116, 34,
  44, 10, 32, 32, 32, 32, 32, 32, 34, 119, 105, 100, 116, 104, 34, 58, 32, 51,
  53, 57, 44, 10, 32, 32, 32, 32, 32, 32, 34, 104, 101, 105, 103, 104, 116, 34,
  58, 32, 50, 52, 51, 44, 10, 32, 32, 32, 32, 32, 32, 34, 115, 101, 101, 100,
  34, 58, 32, 55, 48, 54, 54, 48, 53, 56, 54, 55, 44, 10, 32, 32, 32, 32, 32,
  32, 34, 103, 114, 111, 117, 112, 73, 100, 115, 34, 58, 32, 91, 93, 44, 10, 32,
  32, 32, 32, 32, 32, 34, 114, 111, 117, 110, 100, 110, 101, 115, 115, 34, 58,
  32, 123, 10, 32, 32, 32, 32, 32, 32, 32, 32, 34, 116, 121, 112, 101, 34, 58,
  32, 51, 10, 32, 32, 32, 32, 32, 32, 125, 44, 10, 32, 32, 32, 32, 32, 32, 34,
  98, 111, 117, 110, 100, 69, 108, 101, 109, 101, 110, 116, 115, 34, 58, 32, 91,
  93, 44, 10, 32, 32, 32, 32, 32, 32, 34, 117, 112, 100, 97, 116, 101, 100, 34,
  58, 32, 49, 54, 55, 50, 48, 50, 57, 57, 55, 52, 48, 50, 56, 44, 10, 32, 32,
  32, 32, 32, 32, 34, 108, 105, 110, 107, 34, 58, 32, 110, 117, 108, 108, 44,
  10, 32, 32, 32, 32, 32, 32, 34, 108, 111, 99, 107, 101, 100, 34, 58, 32, 102,
  97, 108, 115, 101, 10, 32, 32, 32, 32, 125, 10, 32, 32, 93, 44, 10, 32, 32,
  34, 97, 112, 112, 83, 116, 97, 116, 101, 34, 58, 32, 123, 10, 32, 32, 32, 32,
  34, 103, 114, 105, 100, 83, 105, 122, 101, 34, 58, 32, 110, 117, 108, 108, 44,
  10, 32, 32, 32, 32, 34, 118, 105, 101, 119, 66, 97, 99, 107, 103, 114, 111,
  117, 110, 100, 67, 111, 108, 111, 114, 34, 58, 32, 34, 35, 102, 102, 102, 102,
  102, 102, 34, 10, 32, 32, 125, 44, 10, 32, 32, 34, 102, 105, 108, 101, 115,
  34, 58, 32, 123, 125, 10, 125,
]);

const file = new File([uint8Array], "abc.excalidraw", {
  lastModified: new Date(2020, 1, 1).getTime(),
  type: "",
});

function FakeDataTransfer(file) {
  this.dropEffect = "all";
  this.effectAllowed = "all";
  this.items = [
    {
      getAsFileSystemHandle: async () => null,
    },
  ];
  this.types = ["Files"];
  this.getData = function () {
    return file;
  };
  this.files = {
    item: (index) => {
      return file;
    },
  };
}

const fakeDropEvent = new DragEvent("drop", {bubbles: true});
fakeDropEvent.simulated = true;
Object.defineProperty(fakeDropEvent, "dataTransfer", {
  value: new FakeDataTransfer(file),
});

const node = document.querySelector(".excalidraw-container");
node.dispatchEvent(fakeDropEvent);

